function max(first = -Infinity, ...rest) {
  let maxValue = first;
  for (const v of rest) {
    if (v > maxValue) {
      maxValue = v;
    }
  }
  return maxValue;
}
console.log(max(1, 10, 100, 2, 3, 100, 4, 5, 6)); // 100
function foo(...args) {
  console.log(args);
}
foo(); // []
